'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;

  // /**
  //  *  ws
  //  */

  // app.io.route('chat', app.io.controller.chat.index);

  // // app.io.of('/chat')
  // app.io.of('/chat').route('chat', app.io.controller.chat.index);

  /**
   *  restful api
   */
  router.get('/', controller.home.index);
  router.get('/json', controller.home.json);
  router.get('/save', controller.home.save);
  /**
   * member
   */
  router.post('/member', controller.member.create);
  router.get('/member/:id', controller.member.find);
  router.get('/member/', controller.member.findAll);
  /**
   * shop
   */
  router.post('/shop', controller.shop.create);
  router.get('/shop/:id', controller.shop.find);
  router.get('/shop/', controller.shop.findAll);
  router.put('/shop/:id', controller.shop.update);

  /**
   * analysis
   */

  router.get('/analysis/recommend', controller.analysis.recommend);
  router.get('/analysis/hotshops', controller.analysis.hotShops);
  router.get('/analysis/dineTime', controller.analysis.dineTimeAnalysis);
  router.get('/analysis/userlevel', controller.analysis.userLevelAnalysis);
  router.get('/analysis/hotfoodcategories', controller.analysis.hotFoodCategories);
  router.get('/analysis/businessanalysis', controller.analysis.businessAnalysis);
  router.get('/analysis/qualityshopsanalysis', controller.analysis.qualityShopsAnalysis);


  /**
   * food category
   */
  router.get('/foodcategory', controller.foodcategory.getAll);
  router.post('/foodcategory', controller.foodcategory.save);


};
